<template>

  <div :class="{'loader-container':isRecording}">
    <div class="rectangle-1"></div>
    <div class="rectangle-3"></div>
    <div class="rectangle-2"></div>
    <div class="rectangle-4"></div>
    <div class="rectangle-5"></div>
    <div class="rectangle-6"></div>
    <div class="rectangle-5"></div>
    <div class="rectangle-6"></div>
    <div class="rectangle-2"></div>
    <div class="rectangle-3"></div>
    <div class="rectangle-1"></div>
  </div>
</template>

<script>
  export default {
    name: "fiddle",
    props: {
      isRecording: {
        type: Boolean,
        default: false
      },
    }
  }
</script>

<style lang="scss" scoped>
  @import "../../uni";

  .loader-container {
    display: flex;
    height: upx(40);
    width: upx(130);
  }

  .loader-container > div {
    background: white;
    height: 100%;
    width: upx(10);
    margin: 0 upx(5);
    animation: load 3s ease-in-out infinite;
  }

  .loader-container .rectangle-2 {
    animation-delay: 0.1s;
  }

  .loader-container .rectangle-3 {
    animation-delay: 0.4s;
  }

  .loader-container .rectangle-4 {
    animation-delay: 0.2s;
  }

  .loader-container .rectangle-5 {
    animation-delay: 0.1s;
  }

  .loader-container .rectangle-6 {
    animation-delay: 0.3s;
  }

  @keyframes load {
    0%, 100% {
      transform: scaleY(1);
      background: #03D2B7;
    }
    16.67% {
      transform: scaleY(2);
      background: #03D2B7;
    }
    33.33% {
      transform: scaleY(1);
      background: #03D2B7;
    }
    50% {
      transform: scaleY(3);
      background: #03D2B7;
    }
    66.67% {
      transform: scaleY(1);
      background: #03D2B7;
    }
    83.34% {
      transform: scaleY(2);
      background: #03D2B7;
    }
  }
</style>
